﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Text;

using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;

using System.Data.Services.Client;

namespace Net.SyntaxC4.WindowsAzure.EmailQueue.BLL
{
    public class Email : TableServiceEntity
    {

        public Email(string senderEmailAddress, string recipientEmailAddresses, string emailSubject, string emailBody)
        {
            /// <summary>
            ///     Used in case Windows Azure needs to distribute
            ///     Entities across Multiple Storage Nodes
            /// </summary>
            PartitionKey = senderEmailAddress;

            /// <summary>
            ///     Used to Uniquely Identify the particular row
            ///     in each Partition.
            /// </summary>
            RowKey = Guid.NewGuid().ToString();

            RecipientEmailAddresses = recipientEmailAddresses;
            EmailSubject = emailSubject;
            EmailBody = emailBody;
            EmailAttachmentIDs = string.Empty;
        }

        public Email() :
            base("", string.Format("{0:d10}", DateTime.Now.Ticks)) { }

        public string RecipientEmailAddresses
        {
            get;
            set;
        }
        public string EmailSubject
        {
            get;
            set;
        }
        public string EmailBody
        {
            get;
            set;
        }
        public string EmailAttachmentIDs
        {
            get;
            set;
        }
    }
}
